﻿@using IdentityStudy.Models
@using IdentityStudy.Services
@using System.Security.Claims;

@inject IdentityService IdentityService

@if (User.Claims.Any(c=>c.Type == ClaimTypes.Name))
{
    <form asp-area="" asp-controller="Account" asp-action="LogOff" method="post" id="logoutForm" class="navbar-right">
        <ul class="nav navbar-nav navbar-right">
            <li>
                <a href="#" title="Manage">欢迎  @User.FindFirst(ClaimTypes.Name)?.Value !</a>
            </li>
            <li>
                <button type="submit" class="btn btn-link navbar-btn navbar-link">注销</button>
            </li>
        </ul>
    </form>
}
else
{
    <ul class="nav navbar-nav navbar-right">
        <li><a asp-area="" asp-controller="Account" asp-action="Register">注册</a></li>
        <li><a asp-area="" asp-controller="Account" asp-action="Login">登录</a></li>
    </ul>
}
